//
//  GlobalConstants.h
//  bird_cloud_artist
//
//  Created by 闫珍 on 17/1/4.
//  Copyright © 2017年 dianchuang. All rights reserved.
//

#ifndef GlobalConstants_h
#define GlobalConstants_h

#define BaseURLString               @"http://jia.heipa.com/api/"
//好友列表
#define FriendListURLString            [BaseURLString stringByAppendingString:@"phoneapi_girl.php?mod=get_friend_list"]

//自定义导航高度
#define CUSTOM_NAV_HEIGHT             44
#define CUSTOM_TABBAR_HEIGHT            49

//*********************************通用define************************************//

//是否debug测试
#define NEED_OUTPUT_LOG                 1

//定义NSUserDefaults
#define USER_DEFAULT                [NSUserDefaults standardUserDefaults]

#define UDUserInfoIdentify          @"User_info"
#define UDUserInfo                  [USER_DEFAULT objectForKey:UDUserInfoIdentify]

#define UDfirstLaunchIdentify       @"User_firstLaunch"
#define UDfirstLaunch               [USER_DEFAULT objectForKey:UDfirstLaunchIdentify]

//沙盒存储路径
#define HomeDirectory               [NSHomeDirectory() stringByAppendingString:@"/Documents/"]

//缓存路径
#define APP_CACHES_PATH             [NSSearchPathForDirectoriesInDomains (NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]

//屏幕物理宽、高
#define APP_SCREEN_WIDTH            [UIScreen mainScreen].bounds.size.width
#define APP_SCREEN_HEIGHT           [UIScreen mainScreen].bounds.size.height

//除去状态栏高
#define APP_SCREEN_CONTENT_HEIGHT   ([UIScreen mainScreen].bounds.size.height-20.0)

//是否iphone5以上
#define IS_4_INCH                   (APP_SCREEN_HEIGHT > 480.0)

//当前app版本
#define Current_Version             [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]

//当前app build
#define Current_Build             [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]

//手机版本
#define Current_device_vesion       [[[UIDevice currentDevice] systemVersion] floatValue]

//设置RGB颜色
#define RGBCOLOR(r,g,b)             [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1]
#define RGBACOLOR(r,g,b,a)          [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
//颜色
//导航栏颜色
#define DefaultColor_Nav        RGBCOLOR(255,110,155)
//分割线的颜色
#define DefaultColor_Line        RGBCOLOR(222,222,222)

#define DefaultNavigationColor       RGBCOLOR(255, 110, 155)
#define DefaultViewBackgroundColor   RGBCOLOR(238, 238, 238)
#define DefaultBorderColor           RGBCOLOR(216, 216, 219)


#if NEED_OUTPUT_LOG

#define SLog(xx, ...)   NSLog(xx, ##__VA_ARGS__)
#define SLLog(xx, ...)  NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)

#define SLLogRect(rect) \
SLLog(@"%s x=%f, y=%f, w=%f, h=%f", #rect, rect.origin.x, rect.origin.y, \
rect.size.width, rect.size.height)

#define SLLogPoint(pt) \
SLLog(@"%s x=%f, y=%f", #pt, pt.x, pt.y)

#define SLLogSize(size) \
SLLog(@"%s w=%f, h=%f", #size, size.width, size.height)

#define SLLogColor(_COLOR) \
SLLog(@"%s h=%f, s=%f, v=%f", #_COLOR, _COLOR.hue, _COLOR.saturation, _COLOR.value)

#define SLLogSuperViews(_VIEW) \
{ for (UIView* view = _VIEW; view; view = view.superview) { SLLog(@"%@", view); } }

#define SLLogSubViews(_VIEW) \
{ for (UIView* view in [_VIEW subviews]) { SLLog(@"%@", view); } }

#else

#define SLog(xx, ...)  ((void)0)
#define SLLog(xx, ...)  ((void)0)

#endif

#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;

/** 是否已经登录 全局变量 */
static BOOL Global_isLogin;
static int Status_Gap = 20;
static int NavHeight = 64;

#endif /* GlobalConstants_h */
